#pragma once

#include <Windows.h>
#include <functional>
#include <vector>

struct CMenuInfo
{
	LPCTSTR name;			//@Commit:Canonical Name.
	LPCTSTR cmdString;		//@Commit:For GetCommandString.Could be NULL.
	HANDLE hBitmapICon;	//@Commit:ICon

	//@Noted:This member could refactor as Action which means that it can register more than one callback function.
	std::function<void(void*)> OnCommand;	//@Commit:Callback Fucntion Triggered while user clicking the memnu.
	UINT menuID;
	//@Commit:If thi flag is true.Ignore OnCommand.
	bool isPopup;
	//@Commit:ChildMenus For Popup Menu subMenu.
	std::vector<CMenuInfo*> subMenus;
	bool hasParent;
	const static std::vector<CMenuInfo*> NoSubMenus;
};

HRESULT InitializeAllMenuItems();
HRESULT ReleaseMenuResource();
UINT GetAllMenusNumber();
CMenuInfo* GetAllMenuInstatnce();